<%--
  Created by IntelliJ IDEA.
  User: SXT
  Date: 2020/10/12
  Time: 10:22
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>登录页面</title>
    <base href="<%=request.getContextPath()+"/"%>">
    <%--导入easyui核心的css--%>
    <link rel="stylesheet" href="easyui/themes/default/easyui.css">
    <%--导入easyui图标及css--%>
    <link rel="stylesheet" href="easyui/themes/icon.css">
    <%--导入基本默认css样式--%>
    <link rel="stylesheet" href="easyui/themes/demo.css">
    <%--导入jq依赖的js文件--%>
    <script type="text/javascript" src="easyui/jquery.min.js"></script>
    <%--导入easyui核心js--%>
    <script type="text/javascript" src="easyui/jquery.easyui.min.js"></script>

    <script type="text/javascript">

        $(function () {
            $("#btn2").click(function () {

                if($("#uname").val()==""||$("#uname").val()==null){
                    $.messager.alert('警告','用户名不能为空！','question');
                }else  if($("#pwd").val()==""||$("#pwd").val()==null){
                    $.messager.alert('警告','密码不能为空！','question');
                }else{
                    //提交表单即可
                    $.post("admin/adminLogin",$("#fm").serialize(),function (result) {
                        if(result){
                            window.location.href="main.jsp"
                        }else{
                            $.messager.alert('警告','登录失败','error');
                        }

                    })

                }


            })

        })

    </script>

</head>
<body>
<%--class:增加easyui 的样式
    data-options:增加easyui 的组件
--%>
<div style="margin-top: 200px;margin-left: 455px">
    <div id="d" style="width: 400px;height: 300px;" class="easyui-panel" title="登录"
         data-options="iconCls:'icon-add',closable:false,collapsible:false,minimizable:true,maximizable:true">

        <form id="fm">
            <div style="margin-top: 65px;margin-left: 80px">
                <input id="uname" name="aname" type="text" class="easyui-textbox" data-options="iconCls:'icon-search',prompt:'User'" style="width:60%"/>
            </div>
            <div  style="margin-top: 30px;margin-left: 80px">
                <input id="pwd" name="apwd" type="text" class="easyui-passwordbox" data-options="prompt:'PassWord'" style="width:60%"/>
            </div>

            <div style="margin-top: 30px;margin-left: 102px">
                <a id="btn1" href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'">Clear</a>

                <a id="btn2" href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-ok'">Login</a>
            </div>
        </form>

    </div>
</div>


</body>
</html>
